import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/SystemView'),
    hidden: true
  },

  //用户模式
  {
    path: '/User',
    name: 'User',
    component: () => import('@/views/User/UserView.vue'),
    children: [
      {
        path: '/User/UserReservation',
        name: 'UserReservation',
        component: () => import('@/components/User/MyReservation.vue'),
      },
      {
        path: '/User/ReserveRoom',
        name: 'ReserveRoom',
        component: () => import('@/components/User/ReserveRoom.vue'),
      },
      {
        path: '/User/UserInfo/',
        name: 'UserInfo',
        component: () => import('@/components/User/UserInfo.vue'),
      },
    ]
  },
  {
    path: '/UserRegisterView',
    component: () => import('@/views/User/UserRegisterView.vue'),
    hidden: true
  },
  {
    path: '/UserLoginView',
    component: () => import('@/views/User/UserLoginView.vue'),
    hidden: true
  },

  //自习室管理员模式
  {
    path: '/StudyRoomAdmin',
    name: 'StudyRoomAdmin',
    component: () => import('@/views/StudyRoomAdmin/StudyRoomAdminView.vue'),
    children: [
      {
        path: '/StudyRoomAdmin/HandleReservation',
        name: 'HandleReservation',
        component: () => import('@/components/StudyRoomAdmin/HandleReservation.vue'),
      },
      {
        path: '/StudyRoomAdmin/MyStudyRoom',
        name: 'MyStudyRoom',
        component: () => import('@/components/StudyRoomAdmin/MyStudyRoom.vue'),
      },
    ]
  },
  {
    path: '/StudyRoomAdminLoginView',
    component: () => import('@/views/StudyRoomAdmin/StudyRoomAdminLoginView.vue'),
    hidden: true
  },

  //超级管理员模式
  {
    path: '/SuperAdmin',
    name: 'SuperAdmin',
    component: () => import('@/views/SuperAdmin/SuperAdminView.vue'),
    children: [
      {
        path: '/SuperAdmin/ManageAdmin',
        name: 'ManageAdmin',
        component: () => import('@/components/SuperAdmin/ManageAdmin.vue'),
      },
      {
        path: '/SuperAdmin/ManageRoom',
        name: 'ManageRoom',
        component: () => import('@/components/SuperAdmin/ManageRoom.vue'),
      },
      {
        path: '/SuperAdmin/ManageUser',
        name: 'ManageUser',
        component: () => import('@/components/SuperAdmin/ManageUser.vue'),
      },
    ]
  },
  {
    path: '/SuperAdminLoginView',
    component: () => import('@/views/SuperAdmin/SuperAdminLoginView.vue'),
    hidden: true
  },
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
